# create a new vector for RoB per study as the current RoB is per arm
# if low & low --> low, low&moderate --> low, otherwise high
add_rob_study <- function(data=antidep){
study_id <- unique(data$studyid)
add_rob <- sapply(study_id, function(s){
data_per_study <- data%>%filter(studyid==s)
data_per_study$ROB_study <-ifelse(sum(data_per_study$ROB%in%'High risk')>0,'High risk',
ifelse(sum(!data_per_study$ROB%in%'Moderate risk')==0,'Moderate risk','Low risk'))
data_per_study
},simplify = F)
add_rob_data<- do.call(rbind,add_rob)
add_rob_data$ROB_study <- as.factor(add_rob_data$ROB_study)
levels(add_rob_data$ROB_study) <- c('high','low','high')
add_rob_data$cov <- abs(as.numeric(as.factor(add_rob_data$ROB_study))-2)
add_rob_data
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.